package cn.com.surker.production.service;

import cn.com.surker.production.entity.ProductionPumpBill;
import cn.com.surker.production.vo.PumpBillVo;
import cn.com.surker.spring.RestResultDto;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.util.List;

/**
 * @Author lucky
 * @create 2025年05月23 15:27
 * @desc
 */
public interface PumpBillService {

    /**
     * 分页查询泵送结算
     * @param billVo
     * @param offset
     * @param limit
     * @return
     */
    IPage findByPage(PumpBillVo billVo, Integer offset, Integer limit);

    List<ProductionPumpBill> findBillList(PumpBillVo billVo);

    List<PumpBillVo> findBillData(PumpBillVo billVo);

    /**
     * 保存结算数据
     * @param bill
     * @return
     */
    RestResultDto saveBill(ProductionPumpBill bill);

    /**
     * 修改结算数据
     * @param bill
     * @return
     */
    RestResultDto updateBill(ProductionPumpBill bill);

    /**
     * 修改结算数据状态
     * @return
     */
    RestResultDto updateStatus(Long id, Integer status, String creator);

    /**
     * 修改结算数据状态
     * @return
     */
    RestResultDto updateStatusV1(String today, Long orgId, Long supplierId, Integer status, String creator);

    /**
     * 修改导出状态
     * @return
     */
    RestResultDto updateExport(String today, Long orgId, Long supplierId, Integer isExport, String creator);
    /**
     * 查询是否审核
     * @param orgId
     * @param today
     * @return
     */
    Integer todayExamine(Long orgId, String today);

    /**
     * 审核购进明细报表
     * @param orgId
     * @param today 时间点
     * @param creator
     * @param type 0 材料统计 1 财务
     * @return
     */
    RestResultDto examineBill(Long orgId, String today, String creator, Integer type);

    /**
     *
     * @param orgId
     * @param supplierId
     * @param pumpNorms
     * @param pumpType
     * @param priceType
     * @return
     */
    RestResultDto calcBill(Long orgId, Long supplierId, Long pumpNorms, Long pumpType,
                           Integer priceType, String today, String startTime, String endTime, String creator);

    /**
     * 导出明细
     * @param sheetName
     * @param title
     * @param billList
     * @return
     */
    XSSFWorkbook exportDetail(String sheetName, String title, List<ProductionPumpBill> billList);

    /**
     * 导出结算单
     * @return
     */
    XSSFWorkbook exportBill(String sheetName, String title, Long orgId, Long supplierId, String startTime,
                            String endTime, List<ProductionPumpBill> billList, String creator);

}
